if __name__ == "__main__":
    fo = open("PY202.txt","w",encoding="utf-8")
    def is_prime(n):
        if n <= 1:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        for i in range(3, int(n**0.5) + 1, 2):
            if n % i == 0:
                return False
        return True
    ls=[51,33,54,56,67,88,431,111,141,72,45,2,78,12,15,5,69]
    lis = []
    for i in ls:
        if is_prime(i)== True:
            lis.append(i)
    fo.write(">>>{}，列表长度为{}".format(lis,len(lis)))
    fo.close()

